/**
 * 地图实时数据公共模块
 */
(function(window, angular, undefined){
	var module = angular.module('water.apps.common.stationMap.stationMapRealDataManager', []);
	module.controller('commonStationMapRealDataManagerController',function($rootScope,$state,$gisObject,$formObject,$scope,$waterDataCommon,$wdp){
		if($wdp.viewValue.isMisWatch){
			$wdp.viewValue.isMisWatch();
		}
		$wdp.viewValue.isMisWatch = $rootScope.$watch(function(){return $formObject.isMIS;},function(){
			$scope.showAllStationData = false;
        },true);
		
		$scope.showAllStationData = false;
		$scope.pollToList =[{name:"STATIONNAME",parmName:"站点"},{name:"VOC",parmName:"VOC"},{name:"DQY",parmName:"大气压"},
		                    {name:"THC",parmName:"总碳氢化合物"},{name:"AT",parmName:"温度"},{name:"SD",parmName:"湿度"},
		                     {name:"STINK",parmName:"臭气浓度"},{name:"WD",parmName:"风向"},{name:"WIND_SPEED",parmName:"风速"},{name:"H2S",parmName:"硫化氢"}];
		
		$scope.showAllStationDataList = function(){
			$scope.showAllStationData = !$scope.showAllStationData;
			$gisObject.map.infoWindow.hide();
			if($scope.showAllStationData){
				$scope.getAllStationDataList();
			}
			//地图实时数据对齐
			$(".head_row_table").css("display","none");
		}
		
		$scope.getAllStationDataList = function(){
			var pollToChecked = "";
			for(var i=0;i<$scope.pollToList.length;i++){
				pollToChecked += $scope.pollToList[i].name+",";
			}
			$waterDataCommon.getPageRows("/DataReport/AllStationRealTimeData.do","ReportList",{"parmToChecks":pollToChecked},1,1);
		}
		
		$scope.closeAllStationData = function(){
			$scope.showAllStationData = false;
		}
	});
}(window, angular));